package com.dhb.pattern.singleton.hungry;

/**
 * 功能描述：饿汉式单例的另一种写法，通过静态块进行实例化。
 * 创建人：citymoon
 * 创建日期：2019/5/4
 */
public class HungryStaticblockSingleton {

    private static final HungryStaticblockSingleton hungryStaticblockSingleton;

    static {
        hungryStaticblockSingleton = new HungryStaticblockSingleton();
    }

    private HungryStaticblockSingleton(){}

    public static HungryStaticblockSingleton getInstance(){
        return hungryStaticblockSingleton;
    }
}
